import request from '@/config/axios'

export interface ProductSkuVO {
  id: number
  productId: number
  value: string
  price: number
}

// 查询列表
export const getProductRenewPage = async (id: number) => {
  return await request.get({ url: `/system/product/get-renewal-item-list?productId=` + id })
}

// 查询详情
export const getProductRenewDetails = async (id: number) => {
  return await request.get({ url: `/system/product/get-renewal-item?id=` + id })
}

// 新增
export const createProductRenew = async (data: ProductSkuVO) => {
  return await request.post({ url: `/system/product/create-renewal-item`, data })
}

// 修改
export const updateProductRenew = async (data: ProductSkuVO) => {
  return await request.put({ url: `/system/product/update-renewal-item`, data })
}

// 删除
export const deleteProductRenew = async (id: number) => {
  return await request.delete({ url: `/system/product/delete-renewal-item?id=` + id })
}

// 通过code查询列表
export const getProductRenewByCode = async (code: string) => {
  return await request.get({ url: `/system/product/get-renewal-item-list-by-code?productCode=` + code })
}
